// src/api/mockLogin.js

export default async function mockLogin(username, password) {
    // 这里仅作示例，实际项目应替换为与后端交互的API调用
    const users = [
      { username: '00', password: '123456', id: 1 },
      { username: '11', password: '123456789', id: 2 },
    ];
  
    const matchedUser = users.find(
      (user) => user.username === username && user.password === password
    );
  
    if (matchedUser) {
      return {
        success: true,
        user: { ...matchedUser },
      };
    } else {
      return {
        success: false,
        message: 'Invalid username or password',
      };
    }
  }